<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑品牌信息</title>
<style type="text/css">
	body{
		background:#dae4fe;
	}
	form{
		margin:20px;
		font-size:14px;
	}
	label{
		font-size:14px;
		color:red;
		margin-left:95px;
	}
	div{
		font-weight:bold;
		font-size:14px;
		margin:5px;
	}
	.one{
		width:125px;
		float:right;
		text-align:right;
	}
</style>
<link rel=stylesheet type=text/css href="css/input.css">
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<script type="text/javascript">
	$(function(){
		$(".def").click(function(){
			var bid = $("#bid").val();
			var bname = $("#bname").val();
			alert(bname);
			$.get("updatebrand",{bid:bid,bname:bname},function(v){
				$("#label1").html(v);
			});
		});
	});
	function chongzhi(){
		location.reload();
	}
</script>
</head>
<body>
	<div>
		品牌管理->编辑品牌信息
	</div>
	<hr>
	<form>
		<table>
			<tr>
				<td class="one">品牌名称：</td>
				<td>
					<select id="bid">
						<c:forEach items="${list}" var="brand">
							<c:if test="${bid eq brand.bId}">
								<option selected="selected" value="${brand.bId}">${brand.bName}</option>
							</c:if>
							<c:if test="${bid ne brand.bId}">
								<option value="${brand.bId}">${brand.bName}</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td class="one">修改后品牌名称：</td>
				<td><input type="text" id="bname"></td>
			</tr>
			<tr>
				<td class="one">
					<a class="def">
						<input type="button" value="修   改">
					</a>
				</td>
				<td>
					<input onclick="chongzhi()" type="button" value="重   置">
				</td>
			</tr>
		</table>
		<label id="label1"></label>
	</form>
</body>
</html>